package com.y.fund.domain.com;

import org.hibernate.annotations.GenericGenerator;

import com.y.fund.aacore.abs.TimeObj;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "co12_msg")
@GenericGenerator(name="assignGenerator", strategy="assigned")
@Schema(title="消息对象")
public class CO12Message extends TimeObj {

	@Column(name = "owner_id", length=64, nullable=false, updatable=false)
	@Schema(title = "消息所属用户ID [user]")
	private String ownerId;
	
	@Size(max = 256)
	@Column(name = "m_title", length=256)
	@Schema(title = "消息标题[256位长度]")
	private String title;

	@Size(max = 3000)
	@Column(name = "m_cont", length=3000)
	@Schema(title = "消息内容[3000位长度]")
	private String cont;

	@Column(name="biz_id", length=64, updatable=false)
	@Schema(title = "此消息对应的业务数据ID")
	private String bizId;
	
	@Column(name = "m_type")
	@Schema(title = "消息类型，1：普通消息，2：待办")
	private Integer type;

	@Column(name="web_link", length=128, updatable=false)
	@Schema(title = "如果是待办，在WEB页面将要跳转的操作链接地址")
	private String webLink;

	@Column(name="app_link", length=128, updatable=false)
	@Schema(title = "如果是待办，在APP端将要跳转的操作链接地址")
	private String appLink;
	
	@Column(name = "is_read")
	@Schema(title = "是否已读，0|null: 未读; 1: 已读]")
	private Integer read;

	@Column(name = "is_done")
	@Schema(title = "业务是否已完成，0|null: 未读; 1: 已读]")
	private Integer done;

	public CO12Message() {
		super();
	}

	public CO12Message(String ownerId) {
		super();
		this.ownerId = ownerId;
	}

	public CO12Message(String ownerId, String title, String cont, String bizId, Integer read) {
		super();
		this.ownerId = ownerId;
		this.title = title;
		this.cont = cont;
		this.bizId = bizId;
		this.read = read;
	}
}
